package com.summer.system.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.summer.core.annotations.ScopeType;

@Component
@Scope(ScopeType.SESSION)
public class LoginUtil {
	
	private String goBack;
	
	@Autowired
	private HttpServletRequest request;
	
	public void setSession(String key,String value){
		
		HttpSession session = request.getSession();
		request.getSession().setAttribute(key, value);
	}

	public String getGoBack() {
		return goBack;
	}

	public void setGoBack(String goBack) {
		setSession("goBack",goBack);
		this.goBack = goBack;
	}
	
	
}